﻿using Storage.Mapping.Bucket;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Storage.Entities;

namespace Storage.Services.Bucket
{
    public interface IBucketService
    {
        /// <summary>
        /// 获取所有的数据并缓存
        /// </summary>
        /// <returns></returns>
        List<BucketMapping> getAllCache();

        /// <summary>
        /// 通过名称获取
        /// </summary>
        /// <param name="name"></param>
        /// <returns></returns>
        BucketMapping getByName(string name);

        /// <summary>
        /// 
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        BucketMapping getById(Guid id);

        /// <summary>
        /// 验证名称是否已经被占用
        /// </summary>
        /// <param name="id"></param>
        /// <param name="name"></param>
        /// <returns></returns>
        bool existName(Guid id, string name);
        /// <summary>
        /// 
        /// </summary>
        /// <param name="entity"></param>
        void insertBucket(Entities.Bucket entity);
         
    }
}
